﻿using HarmonyLib;
using PeterHan.PLib.Options;
using System.Collections.Generic;
using TUNING;

namespace oxygen_mod
{
    public partial class Patches
    {
        [HarmonyPatch(typeof(Db))]
        [HarmonyPatch("Initialize")]
        public class Patch_Food_Start
        {
            private static void Prefix()
            {
                CROPS.CROP_TYPES = new List<Crop.CropVal>
                {
                    new Crop.CropVal("BasicPlantFood", SingletonOptions<ModSettings>.Instance.TimeNum * 100f, (int)SingletonOptions<ModSettings>.Instance.RiceLiceNum, true),
                    new Crop.CropVal(PrickleFruitConfig.ID, 600f, 1, true),
                    new Crop.CropVal(SwampFruitConfig.ID, 600f, 1, true),
                    new Crop.CropVal(MushroomConfig.ID, 600f, 1, true),
                    new Crop.CropVal("ColdWheatSeed", 600f, 1, true),
                    new Crop.CropVal(SpiceNutConfig.ID, 600f, 1, true),
                    new Crop.CropVal(BasicFabricConfig.ID, 600f, 1, true),
                    new Crop.CropVal(SwampLilyFlowerConfig.ID, 600f, 1, true),
                    new Crop.CropVal("GasGrassHarvested", 600f, 1, true),
                    new Crop.CropVal("WoodLog", 600f, 1, true),
                    new Crop.CropVal("Lettuce", 600f, 1, true),
                    new Crop.CropVal("BeanPlantSeed", 600f, 1, true),
                    new Crop.CropVal("OxyfernSeed", 600f, 1, true),
                    new Crop.CropVal("PlantMeat", 600f, 1, true),
                    new Crop.CropVal("WormBasicFruit", 600f, 1, true),
                    new Crop.CropVal("WormSuperFruit", 600f, 1, true),
                    new Crop.CropVal(SimHashes.Salt.ToString(), 600f, 1, true),
                    new Crop.CropVal(SimHashes.Water.ToString(), 600f, 1, true)
                };
                FOOD.FOOD_TYPES.BASICPLANTFOOD.CanRot = false;
                FOOD.FOOD_TYPES.BASICPLANTBAR.CanRot = false;
                FOOD.FOOD_TYPES.PICKLEDMEAL.CanRot = false;
                FOOD.FOOD_TYPES.BASICPLANTFOOD.Quality = 4;
                FOOD.FOOD_TYPES.BASICPLANTBAR.Quality = 4;
                FOOD.FOOD_TYPES.PICKLEDMEAL.Quality = 4;
            }
        }
    }
}
